﻿var JBScriptPAGE = JBScriptPAGE || {};

JBScriptPAGE.loginBox = {

	init : function() {

		var formContent = document.getElementById("formContent");
		var statusString = document.getElementById("statusString");

		if (statusString.innerHTML != "")
		{
			formContent.setAttribute("class", "");
		}

		if (formContent != null) {
			
			if (formContent.getAttribute("class") == "hide") 
			{
				formContent.setAttribute("class", "hide");
			}
			
			if (formContent.getAttribute("class") == "") 
			{
				formContent.setAttribute("class", "");
			}
			
			var accountHeading = document.getElementById("accountHeading");

			var a;
			a = document.createElement("a");
			a.href = "#";

			var openImg;
			openImg = document.createElement("img");
			openImg.src = "_img/open_close.png";

			a.appendChild(openImg);
			accountHeading.appendChild(a);

			a.onclick = function()
			{
				if (document.getElementById("formContent").getAttribute("class") == "hide") 
				{
					document.getElementById("formContent").setAttribute("class", "");
				} else 
				{
					document.getElementById("formContent").setAttribute("class", "hide");
				}
				return false;
			};
		}
	}
};

window.onload = JBScriptPAGE.loginBox.init;
